/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

#include "eagle.h"
namespace Eagle
{

    void envInit ()
    {
        if(SDL_Init( SDL_INIT_EVERYTHING )< 0){
            throw "SDL init ERROR!";
        }
    }
    graph graphInit(int h, int w,int flags)
    {
        graph t0 = SDL_SetVideoMode( h, w, 32, flags );
        if(t0 = nullptr){
            throw "graph INITING ERROR!";
        }
        return t0;
    }

    namespace draw
    {
        static const double Pi = 3.1414926535;

//        void
//        setcolor (color_t r, color_t g, color_t b, color_t a)
//        {
//            defaultColor.r = r;
//            defaultColor.g = g;
//            defaultColor.b = b;
//            defaultColor.a = a;
//        }
//        void  setcolor(unsigned long long col)
//        {
//            defaultColor = *((color*) (&col));
//        }


        void
        flush (graph g)
        {
            SDL_Flip(g);
        }
    }

}
